﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using JTLeigh.Commerce.Spencer.Features.ProductImages.Common.Entities;
using JTLeigh.Commerce.Spencer.Features.ProductImages.Business.Caches;

namespace JTLeigh.Commerce.Spencer.Features.ProductImages.Business.UnitTests.Caches
{

	 /// <summary>
	 /// Unit tests for the <see cref="NullProductImageMetadataCache"/> class.
	/// </summary>
	[TestClass]
    public class NullProductImageMetadataCacheFixture
    {

		#region Fields

		private static Guid TestTenantId = Guid.NewGuid();

		#endregion // Fields
		
		#region Methods

		#region ProductImageMetadata

		/// <summary>
		/// Ensures <see cref="NullProductImageMetadataCache.GetProductImageMetadata"/> always 
		/// returns <see langword="null"/> regardless of whether image metadata has been added to 
		/// the cache via <see cref="NullProductImageMetadataCache.SetProductImageMetadata"/>.
		/// </summary>
		[TestMethod]
        public void TestGetSetProductImageMetadata()
        {
			NullProductImageMetadataCache cache;
			ProductImageMetadata metadata;

			cache = new NullProductImageMetadataCache();
			Assert.IsNull(cache.GetProductImageMetadata(TestTenantId));

			metadata = new ProductImageMetadata();
			cache.SetProductImageMetadata(TestTenantId, metadata);
			Assert.IsNull(cache.GetProductImageMetadata(TestTenantId));
		}

		#endregion // ProductImageMetadata

        #endregion // Methods

    }

}
